package com.yjd.bi.user.service;

import java.util.Map;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.bi.report.enums.StatisticsTypeEnum;
import com.yjd.bi.report.enums.TimeType;
import com.yjd.bi.report.model.EChartsMapModel;
import com.yjd.bi.report.model.EChartsModel;
import com.yjd.bi.user.model.UserSexStatisticsModel;
import com.yjd.bi.user.model.UserStatisticsConditionModel;

/**
 * <b>description</b>：每日汇总统计业务接口<br>
 * <b>time</b>：2016-04-26 16:48:56 <br>
 * <b>author</b>：  carl
 */
public interface IUserStatisticsConditionService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public UserStatisticsConditionModel insert(UserStatisticsConditionModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(UserStatisticsConditionModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;
	
	/**
	 * 
	 * @param timeType 维度类型
	 * @param sex 性别
	 * @param timeFrom 统计截止时间
	 * @param field 统计字段
	 * @return
	 * @throws Exception
	 */
	public EChartsModel getDates(TimeType timeType,Integer sex,Long timeFrom,String field) throws Exception;

	
	/**
	 * 汇总统计用户数量
	 * @param paramMap
	 * @param write
	 * @return
	 * @throws Exception
	 */
	public UserSexStatisticsModel getSummaryModel(Map paramMap, boolean write) throws Exception;
	
	/**
	 * 根据年龄统计用户数量
	 * @param statisticsType 统计类型
	 * @return
	 * @throws Exception
	 */
	public EChartsModel getUserNumByAge(StatisticsTypeEnum statisticsType) throws Exception;
	
	/**
	 * 根据地区统计用户数量
	 * @param statisticsType 统计类型
	 * @return
	 * @throws Exception
	 */
	public EChartsMapModel getUserNumByArea(StatisticsTypeEnum statisticsType) throws Exception;
	
	/**
	 * 总览
	 * 
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public Integer getSummary(Map<String, Object> paramMap)
			throws Exception;
}
